<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:ui="http://java.sun.com/jsf/facelets">
	  
<f:view locale="#{switcher.currentLocale}">	  

<h:head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">

</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

<title>#{msg.alterarFavorito}</title>

	<ui:include src="/layout/Header.xhtml" />
</h:head>

<h:body>
	<ui:include src="/layout/SubMenu_Favoritos.xhtml" />
	<center>
	<h:form>
	<table>
			<tr>
				<td>
					#{msg.nome}: 
				</td>
				<td>
					<h:inputText value="#{favoritoManagedBean.f.nome}" readonly="true" style="backgroung-color: #666666"/>
				</td>
			</tr>
			<tr>
				<td>
					#{msg.ag}: 
				</td>
				<td>
					<h:inputText id="ag" maxlength="4" value="#{favoritoManagedBean.f.agencia}"  required="true"
					requiredMessage="#{msg.ag}: #{msg.campoObrigatorio}"
					validator="#{validator.verificadorGuardarAg}"
					converterMessage="#{msg.ag}: #{msg.valorInvalido}" >
						<f:validateLongRange minimum="0000" maximum="9999"/>
					</h:inputText>
				</td>
			</tr>
			<tr>
				<td>
					#{msg.cc}: 
				</td>
				<td>
					<h:inputText id="cc" maxlength="4" value="#{favoritoManagedBean.f.contaC}" required="true"
					requiredMessage="#{msg.cc}: #{msg.campoObrigatorio}"
					validator="#{validator.verificarExistenciaFavorito}"
					converterMessage="#{msg.cc}: #{msg.valorInvalido}" >
						<f:validateLongRange minimum="0000" maximum="9999"/>
					</h:inputText>
				</td>
			</tr>
	</table>
		<br/>
		<h:commandButton value="#{msg.alterar}" action="#{favoritoManagedBean.alterarFavorito}" />		
		<input value="#{msg.cancelar}" type="button" onclick="window.location='consultarFavoritos.jsf'" /> 
		
		<br/>
		<h:message for="ag" style="color:red" /> <br/>
		<h:message for="cc" style="color:red" /> <br/>
	</h:form>
	</center>		
</h:body>
</f:view>
</html>